[DRAFT] feat: frontend qa app#7400
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| await expect(page.getByRole('heading', { name: 'Swap with Wrapped ETH' })).toBeVisible() | ||
| await expect( | ||
| page.getByText('To continue, click below to wrap your ETH to WETH via an on-chain ERC20 transaction.'), | ||
| ).toBeVisible() | ||
|
|
||
| await page.getByRole('button', { name: 'Wrap ETH' }).click() | ||
|
|
||
| const approvalProofBaseline = await createWethApprovalProofBaseline({ anvilUrl, owner: walletAddress }) | ||
|
|
||
| await expect(page.getByRole('heading', { name: 'Approve WETH' })).toBeVisible({ timeout: 30_000 }) | ||
| await approveWethForCowVaultRelayer(BigInt(ONE_WETH_IN_WEI)) | ||
|
|
||
| await assertWethApprovalProof({ anvilUrl, baseline: approvalProofBaseline, owner: walletAddress, testInfo }) | ||
|
|
||
| await interceptDeterministicWrappedQuote(page, walletAddress) | ||
|
|
||
| await page.goto('about:blank') | ||
| await page.goto(buildMainnetSwapRoute(MAINNET_WETH, MAINNET_USDC, { orderKind: 'sell', sellAmount: '1' })) |
There was a problem hiding this comment.
I expected, from the title, this test to use the ethFlow. However, it wraps the native token, approves the wrapped version and then places the order. Essentially a regular order with an approval step.
Since the approval is covered in the previous test, wouldn't make sense to test only a single order instead?
At a bare minimum, make it clearer that this is not an ethFlow test to avoid same confusions in the future :)
There was a problem hiding this comment.
Renamed/reworked this to a regular WETH -> USDC order-submission smoke. Since the assertion target is order placement, wrap + approval are now fixture setup instead of UI steps, avoiding duplicate approval coverage and ethFlow confusion.
| import { accountSelectors, ethFlowSelectors, swapSelectors, walletSelectors } from './selectors' | ||
|
|
||
| const CONNECT_INJECTED_WALLET_EVENT = 'cowswap-connect-injected-wallet' | ||
| const FORCE_ONCHAIN_APPROVAL_SESSION_KEY = 'cowswap:qaForceOnchainApproval:v0' |
There was a problem hiding this comment.
This is defined twice, and can lead to issues if one of the locations is updated independently. Would it be possible to fetch both from the same place?
There was a problem hiding this comment.
Moved these to a shared macro-free QA constants subpath: @cowprotocol/common-const/qa, so QA and frontend use the same values without importing the macro-backed common-const barrel.
There was a problem hiding this comment.
Are those changes necessary for the qa tests setup?
There was a problem hiding this comment.
Removed the QA-specific hook from libs/wallet; the deterministic connect listener now lives in the frontend app only and is gated by REACT_APP_ENABLE_QA_INJECTED_WALLET, which the QA Playwright config enables.
| if: env.HAS_MAINNET_RPC == 'true' | ||
| run: pnpm --dir apps/cowswap-frontend-qa exec playwright install --with-deps chromium | ||
|
|
||
| - name: Mask RPC secret in logs |
There was a problem hiding this comment.
Do we need to explicitly mask them? AFAICT, gh actions already redacts any secrets printed in the actions.
There was a problem hiding this comment.
Removed the custom masking step and rely on GitHub Actions’ built-in redaction for MAINNET_RPC, which is still passed only via secrets.MAINNET_RPC.
…order submission tests
Summary
Adds a prototype/advisory Playwright QA lane for high-signal release smoke coverage against the built CoW Swap frontend and a pinned Anvil mainnet fork.
This adds:
cowswap-frontend-qaNx project.MAINNET_RPCis unavailable.Status
This is a prototype/advisory QA lane. It should not become a required release gate until the team agrees on ownership, flake policy, runtime, and
MAINNET_RPCavailability in CI.To Test
command -v anvilpnpm --dir apps/cowswap-frontend-qa exec playwright install chromiumMAINNET_RPCto a mainnet archive-capable RPC URL.pnpx nx run cowswap-frontend-qa:e2e:headed -- --trace=on
Non-goals
Background
This adds the concrete Playwright tier described in the QA tiering strategy: production-like release smoke between mocked Cypress coverage and repeated manual QA smoke checks.
The native submission smoke proves the frontend can reach submitted/recent-activity state from a native-token sell path using real wallet/forked on-chain interactions, while stubbing only the live orderbook submission boundary.
Testability hooks
This PR adds narrow testability hooks for deterministic QA:
These hooks do not expose privileged operations; they make existing user/session behavior easier to drive deterministically in the built app.
Fork block
The Anvil fork block is intentionally pinned for reproducibility. It should be refreshed only for a concrete reason: stale route assumptions, provider issues, token/liquidity drift, or an intentional release-smoke refresh.
Review Focus
Please review: